If we want that God should not punish us in the Hereafter, and take us within His mercy, then we have to behave in the same way with people. We should behave well with people, be merciful to them, not create problems for them and forgive them. If this is how we behave in this world, God will also deal with us in the same way.
There are many sayings of the Prophet in Hadith books. The gist is: Be merciful to people on earth, and God Almighty will be merciful to you in the Hereafter. (Sunan al-Tirmidhi 1924) Be merciful to others God will be merciful to you. The gist of the Prophet's sayings is: Be merciful to others, God will be merciful to you. If we want that God should not punish us in the Hereafter, and take us within His mercy, then we have to behave in the same way with people. We should behave well with people, be merciful to them, not create problems for them and forgive them. If this is how we behave in this world, God will also deal with us in the same way. We are being given an incentive to adopt moral values in this world. Why should we speak the truth? Why should we do justice? Why should we be honest? Why should we benefit others? Why should we adhere to these moral teachings? We have been given an incentive here. We are told that you will ultimately go to the world Hereafter. You will have to meet God. You will be presented before God. In this world you live among humans, you live in a society, you live with people, either at home or outside home. If you behaved well with people and were merciful to them, then God will be merciful to you. The gist is: Be merciful to others and God will be merciful to you.